def is_correct_brackets(text):
    while '()' in text or '[]'in textor '{}' in text or '<>' in text:
        text = text. replace('()', '')
        text = text. replace('[]', '')
        text = text. replace('{}', '')
        text = text. replace('<>', '')

  # Возвращаем True, если text  с пустой строкой
    return not text



s = 'Y'


while s != 'n':
    inputString = input(*Введите последовательность
    print(is_correct_brackets(inputString.strip()))
    print('Continue?', ' Enter n or y ' )
    print('end')
